﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ValidationFramework.Web.MVC.Configuration
{
	public class InitializationExpression : IInitializationExpression
	{
		private ClFunctionCallProviderDictionary providers;

		/// <summary>
		/// Initializes a new instance of the InitializationExpression class.
		/// </summary>
		/// <param name="providers"></param>
		public InitializationExpression()
		{
			this.providers = new ClFunctionCallProviderDictionary();
		}

		// --- IInitializationExpression Members

		public void RegisterProvider(Type validatorType, IClientFunctionCallProvider provider)
		{
			this.providers.Add(validatorType.TypeHandle, provider);
		}

		// --- Methods | Helper
		public ClFunctionCallProviderDictionary GetProviderDictionary()
		{
			return providers;
		}
	}
}
